import redis

def main():
    client = redis.Redis(
        host='localhost',
        port=3306,
        password='123456'
    )

    client.set('username','hellokitty',300)
    print(client.ttl('username'))
    print(client.get('username').decode('utf-8'))

    client.set('yuting','300')
    client.incr('yuting')
    client.incrby('yuting',50)

    client.hset('stu1','id','1001')
    client.hset('stu1','name','NAME')
    client.hgetall()
    client.hget('stu1','name').decode('utf-8')

if __name__ == '__main__':
    main()
